//
//  AppDelegate.m
//  leson
//
//  Created by xalo on 15/12/3.
//  Copyright (c) 2015年 王黎. All rights reserved.
//

#import "AppDelegate.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];

    self.window.rootViewController = [[UIViewController alloc] init];
//    版本控制器
    
    
    //UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"2.jpg"]];
    
    //imageView.center = self.window.center;
    //imageView.contentMode = UIViewContentModeScaleAspectFill;
    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 360, 360)];
    //imageView.backgroundColor = [UIColor redColor];
    imageView.center = self.window.center;
    imageView.contentMode =UIViewContentModeScaleAspectFit;
    //imageView.image = [UIImage imageNamed:@"2.jpg"];
    
    
    //动态图片
   //UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)];
//    
//    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)];
//    imageView.center = self.window.center;
//    imageView.contentMode = UIViewContentModeScaleToFill;

    imageView.center = self.window.center;
    imageView.contentMode = UIViewContentModeScaleToFill;
//    UIImage *image1 = [UIImage imageNamed:@"gif－1.tiff"];
//    UIImage *image2  = [UIImage imageNamed:@"gif－2.tiff"];
//    UIImage *image3 = [UIImage imageNamed:@"gif－3.tiff"];
    //UIImage *image1 = [UIImage imageNamed:@"1.jpeg"];
   // UIImage *image2 = [UIImage imageNamed:@"2.jpeg"];
    UIImage *image4 = [UIImage imageNamed:@"4.jpeg"];
    UIImage *image5 = [UIImage imageNamed:@"5.jpeg"];
    UIImage *image6 = [UIImage imageNamed:@"6.jpeg"];
    UIImage *image7 = [UIImage imageNamed:@"7.jpeg"];
    UIImage *image8 = [UIImage imageNamed:@"8.jpeg"];
    UIImage *image9 = [UIImage imageNamed:@"9.jpeg"];
    //jhbjbvjb
    
    
    

    
    //创建一个数组将图片添加进去
   // NSArray *array = [NSArray arrayWithObjects:image1,image2,image3,nil];
NSArray *array = [NSArray arrayWithObjects:image4,image5,image6,image7,image8,image9, nil];
    //播放数组里的所有图片
    imageView.animationImages = array;
    //播放时间
    imageView.animationDuration = 1;
    //播放次数(无限循环)
   // imageView.animationRepeatCount = 5;
    //开始播放
    [imageView startAnimating];
    
    [self.window addSubview:imageView];
    //利用UIImageView实现动画。
    
    
    
    
//    UIViewContentModeScaleToFill,图片适应控件的大小
//    UIViewContentModeScaleAspectFit,按比例去缩放
//    UIViewContentModeScaleAspectFill,按比例  根据图片的大小填满
    
    [self.window makeKeyAndVisible];
    return YES;
}




    









- (void)applicationWillResignActive:(UIApplication *)application {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
